home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / mxcode / sbprocss / process.pas < prev    next >
Pascal/Delphi Source File  |  1995-01-14  |  844b  |  32 lines

  1. program Process; {$R-} {$S-} {$Q-}
  2.     uses
  3.         SBSample,
  4.         CRT;
  5.     procedure ClipSample(var Sample: integer);
  6.         begin
  7.             if Sample > 127 then Sample := 127;
  8.             if Sample < -128 then Sample := -128;
  9.         end;
  10.     procedure ProcessSample(var Sample: byte);
  11.       {Make sure that you clip the sample so it stays in the proper range}
  12.         var
  13.             Temp: integer;
  14.         begin
  15.             Temp := Sample-128;
  16.  
  17.             {Process the sample here}
  18.             Temp := Temp;
  19.  
  20.             ClipSample(Temp);
  21.             Sample := Temp+128;
  22.         end;
  23.     var
  24.         Sample: byte;
  25.     begin
  26.         ResetDSP;
  27.         repeat
  28.             Sample := GetSample;
  29.             ProcessSample(Sample);
  30.             OutputSample(Sample);
  31.         until KeyPressed; ReadKey;
  32.     end.